package com.cndw.kungfu.domain;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import com.cndw.commons.util.BlankUtils;
import com.cndw.kungfu.ext.JsonProcesser;

/**
 * 装备套装
 * 
 * 
 * @author <a href="mailto:whz-work@163.com">汪洪州</a>
 * 
 * @since 1.0 Create on 2011-6-22
 */
public class GoodsSuite {

	/**
	 * 套装id
	 */
	private int id;
	/**
	 * 套装名字
	 */
	private String name;

	/**
	 * 套装属性
	 */
	private String properties;

	/**
	 * 套装装备
	 */
	private Map<Integer, String> goods = new TreeMap<Integer, String>();

	/**
	 * 套装属性
	 */
	private List<GoodsSuiteProp> props = new ArrayList<GoodsSuiteProp>();

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getProperties() {
		return properties;
	}

	public void setProperties(String properties) {
		if (!BlankUtils.isBlank(properties)) {
			try {
				props.addAll(JsonProcesser.objectJsonArrayDecode(properties, GoodsSuiteProp.class));
			} catch (Exception e) {
				e.printStackTrace();
			}
			
		}
		this.properties = properties;
	}

	public List<GoodsSuiteProp> getProps() {
		return props;
	}

	public void setProps(List<GoodsSuiteProp> props) {
		this.props = props;
	}

	public Map<Integer, String> getGoods() {
		return goods;
	}

	public void setGoods(Map<Integer, String> goods) {
		this.goods = goods;
	}

}
